import xml.etree.ElementTree as ET

from pyproj import Proj

center_x_1 = 15.17
center_y_1 = 15.24

center_x_2 = 15.78
center_y_2 = 8.01

center_x_3 = 6.79
center_y_3 = 15.36

# 将其转化为真实经纬度
proj = Proj("+proj=tmerc +lon_0=108.90577060170472 +lat_0=34.37650478465651 +ellps=WGS84")
lon_1, lat_1 = proj(center_x_1, center_y_1, inverse=True)
lon_2, lat_2 = proj(center_x_2, center_y_2, inverse=True)
lon_3, lat_3 = proj(center_x_3, center_y_3, inverse=True)
print(lon_1, lat_1)
print(lon_2, lat_2)
print(lon_3, lat_3)
center_lon_1 = 108.90020652492058
center_lat_1 = 34.37482102827826
shift_lon = lon_1 - center_lon_1
shift_lat = lat_1 - center_lat_1
print('偏移量', shift_lon, shift_lat)
print('计算点位', lon_2 - shift_lon, lat_2 - shift_lat)
center_lon_2 = 108.90015928806662
center_lat_2 = 34.374806706261296
shift_lon_2 = lon_2 - center_lon_2
shift_lat_2 = lat_2 - center_lat_2
print('偏移量', shift_lon_2, shift_lat_2)
print('计算点位', lon_3 - shift_lon_2, lat_3 - shift_lat_2)
center_lon_3 = 108.90018917250805
center_lat_3 = 34.374860015758586
shift_lon_3 = lon_3 - center_lon_3
shift_lat_3 = lat_3 - center_lat_3
print('偏移量', shift_lon_3, shift_lat_3)

# 计算真实经纬度
c_lon, c_lat = proj(-532.97, -132.27, inverse=True)
# o_lon = c_lon - shift_lon
# o_lat = c_lat - shift_lat
print(c_lon, ',', c_lat)
